﻿using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.UI;

public class GetTrackObj : MonoBehaviour {
	private string lastTrack;
	public DianluProductor DianLuProductor;
	// Use this for initialization
	void Start () { }

	// Update is called once per frame
	void Update () {
		foreach (var obj in Vuforia.TrackerManager.Instance.GetStateManager ().GetTrackableBehaviours ()) {
			if (obj != null && (int) obj.CurrentStatus > 1) {
				var new_trackName = obj.transform.name;
				if (lastTrack != new_trackName){
					lastTrack = new_trackName;
					print("被追踪物体为：" + lastTrack);
					DianLuProductor.ProductById(lastTrack);
					PlayerPrefs.SetString("circui_id",lastTrack);
				}
			}
		}
	}
}